package com.bizmerce.rnd.oms.util;

public class CustomFunctionTag {

    public static String printDate(String input) {
        if (input == null)
            return "";
        
        if (input.length() < 8)
            return input;
        else
            return input.substring(0,4)+"-"+input.substring(4,6)+"-"+input.substring(6,8);        
    }
    
    public static String printHscd(String input) {
        if (input == null)
            return "";

        int len = input.length();
        
        if (len == 6)        
            return input.substring(0,4)+"."+input.substring(4);
        else if (len == 10)
            return input.substring(0,4)+"."+input.substring(4,6)+"."+input.substring(6);
        else
            return input;            
    }

}
